<template>
  <div>
    <div class="scroll-box">
      <div class="content-box s-box">
        <slot></slot>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Test1XScroll",

  data() {
    return {};
  },

  mounted() {
    var s = setInterval(() => {
      // var el = document.getElementsByClassName("s-box");
      var el =document.querySelector(".scroll-box")
      if (el) {
        this.$store.commit("setXScrollElement", el);
        clearInterval(s);
      }
    }, 1000);
  },

  methods: {},
};
</script>

<style lang="less" scoped>
.scroll-box {
  width: 65px;
  height: 900px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  transform-origin: 0 0;
  transform: rotate(-90deg);
  top: 60px;
}

.content-box {
  width: fit-content;
  height: 65px;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 60px;
  transform-origin: 0 0;
  transform: rotate(90deg);
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow: auto;
}
.s-box{
  transition: all 0.5s linear;
}
::-webkit-scrollbar {
  display: none;
}
</style>
